home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 October: Mac OS SDK / Dev.CD Oct 96 SDK / Dev.CD Oct 96 SDK2.toast / Development Kits (Disc 2) / OpenDoc Development Framework / ODFDev / ODF / ODFLibrary / Sources / SLODFStr.cpp < prev   
Encoding:
Text File  |  1996-08-16  |  3.3 KB  |  125 lines  |  [TEXT/MPS ]

  1. //========================================================================================
  2. //
  3. //    File:                SLODFStr.cpp
  4. //    Release Version:    $ ODF 1 $
  5. //
  6. //    Copyright:    (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
  7. //
  8. //========================================================================================
  9.  
  10. #include "FWOS.hpp"
  11.  
  12. #ifndef SLODFSTR_H
  13. #include "SLODFStr.h"
  14. #endif
  15.  
  16. #ifndef FWMENU_K
  17. #include "FWMenu.k"
  18. #endif
  19.  
  20. #ifndef SLODFSTR_K
  21. #include "SLODFStr.k"
  22. #endif
  23.  
  24. // for FW_HString and FW_CString
  25. #ifndef FWPSTR_H
  26. #include "FWPStr.h"
  27. #endif
  28.  
  29. // for FW_SOM_TRY
  30. #ifndef FWODFEXC_H
  31. #include "FWODFExc.h"
  32. #endif
  33.  
  34. // for FW_CSharedLibraryResourceFile
  35. #ifndef FWCFMRES_H
  36. #include "FWCFMRes.h"
  37. #endif
  38.  
  39. // for FW_LoadStringByID
  40. #ifndef FWRESACC_H
  41. #include "FWResAcc.h"
  42. #endif
  43.  
  44. // for MULTISTRINGRES
  45. #ifndef FWRESTYP_H
  46. #include "FWResTyp.h"
  47. #endif
  48.  
  49. #ifndef FWPRIDEB_H
  50. #include "FWPriDeb.h"
  51. #endif
  52.  
  53. //========================================================================================
  54. //    Runtime Information
  55. //========================================================================================
  56.  
  57. #ifdef FW_BUILD_MAC    
  58. #pragma segment odfcommands
  59. #endif
  60.  
  61. //----------------------------------------------------------------------------------------
  62. //  FW_PrivLoadUndoStrings 
  63. //----------------------------------------------------------------------------------------
  64.  
  65. void SL_API FW_PrivLoadUndoStrings(Environment* ev, 
  66.                                 unsigned long undoMsgID, 
  67.                                 FW_HString* undoStringRep, 
  68.                                 FW_HString* redoStringRep)
  69. {
  70.     FW_SOM_TRY
  71.     {
  72.         FW_CString undoString(*undoStringRep);
  73.         FW_CString redoString(*redoStringRep);
  74.         
  75.         FW_CSharedLibraryResourceFile resFile(ev);
  76.         
  77.         if (!::FW_LoadStringByIDNoFail(ev, resFile, FW_kUndoStrings, MULTISTRINGRES, undoMsgID, undoString))
  78.             ::FW_LoadStringByID(ev, resFile, FW_kUndoStrings, MULTISTRINGRES, FW_kDefaultUndoMsg, undoString);
  79.         
  80.         if (!::FW_LoadStringByIDNoFail(ev, resFile, FW_kUndoStrings, MULTISTRINGRES, undoMsgID + 1, redoString))
  81.             ::FW_LoadStringByID(ev, resFile, FW_kUndoStrings, MULTISTRINGRES, FW_kDefaultUndoMsg + 1, redoString);
  82.     }
  83.     FW_SOM_CATCH
  84. }
  85.  
  86. //----------------------------------------------------------------------------------------
  87. //  FW_PrivLoadDefaultUndoStrings 
  88. //----------------------------------------------------------------------------------------
  89.  
  90. void SL_API FW_PrivLoadDefaultUndoStrings(Environment* ev, 
  91.                                         FW_HString* undoStringRep, 
  92.                                         FW_HString* redoStringRep)
  93. {
  94.     FW_SOM_TRY
  95.     {
  96.         FW_CString undoString(*undoStringRep);
  97.         FW_CString redoString(*redoStringRep);
  98.         
  99.         FW_CSharedLibraryResourceFile resFile(ev);
  100.         
  101.         ::FW_LoadStringByID(ev, resFile, FW_kUndoStrings, MULTISTRINGRES, FW_kDefaultUndoMsg, undoString);
  102.         ::FW_LoadStringByID(ev, resFile, FW_kUndoStrings, MULTISTRINGRES, FW_kDefaultUndoMsg + 1, redoString);
  103.     }
  104.     FW_SOM_CATCH
  105. }
  106.  
  107. //----------------------------------------------------------------------------------------
  108. //  FW_PrivLoadODFString 
  109. //----------------------------------------------------------------------------------------
  110.  
  111. void SL_API FW_PrivLoadODFString(Environment* ev, 
  112.                                     unsigned long stringID, 
  113.                                     FW_HString* stringRep)
  114. {
  115.     FW_SOM_TRY
  116.     {
  117.         FW_CString aString(*stringRep);
  118.  
  119.         FW_CSharedLibraryResourceFile resFile(ev);
  120.         ::FW_LoadStringByID(ev, resFile, FW_kODFStrings, MULTISTRINGRES, stringID, aString);
  121.     }
  122.     FW_SOM_CATCH
  123. }
  124.  
  125.